<template>
  <div class="box">
    <el-button class="button-edit" type="primary" size="medium" icon="el-icon-edit" @click="handleEdit">操作</el-button>
    <el-card>
      <h2 class="title">{{articelObj.title}}</h2>
      <div class="release_time">发布时间 {{articelObj.createdAt}}</div>
      <div class="content" v-html="articelObj.content"></div>
    </el-card>
  </div>
</template>

<script>
export default {
  props: {
    articelObj: {
      type: Object,
      default: () => {
        return {
          title: "文章标题",
          creatTime: "2020-6-19",
          content: "文章文章文字"
        };
      }
    }
  },
  methods: {
    handleEdit(e) {
      this.$emit("edit", e);
    }
  }
};
</script>

<style lang="scss" scoped>
.title {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;

  padding-bottom: 20px;
}
.release_time {
  margin-top: 20px;
  font-size: 14px;
  color: #666;
  text-align: center;
  padding-bottom: 20px;
  border-bottom: 1px dashed #000;
}
.content {
  margin-top: 30px;
  //   display: flex;
  //   justify-content: center;
  //   align-items: center;
}
.button-edit {
  margin-top: 20px;
}
</style>